import React, {Component} from 'react'
import {Image} from 'antd';
import {connect} from "react-redux";


class ShowUserInfo extends Component {
    constructor(props) {
        super(props)
        this.state = {
            mId: '',
            data: {},
        }
    }


    componentDidMount() {
        // this.setState({ data: this.props.data })
        //
    }


    onFinishFailed = (errorInfo) => {

    };

    render() {
        const {details} = this.props
        return (
            <div style={{
                width: '100%',
                height: '100%',
                marginLeft: 100,
                fontSize: 16,
                lineHeight: '300%',
                fontFamily: 'PingFangSC-Medium'
            }}>
                <div>姓名：{details ? details.name : '暂无数据'}</div>
                <div>性别：{details ? (details.gender === 1 ? '男' : '女') : '暂无数据'}</div>
                <div>身份证号：{details ? details.identity : '暂无数据'}</div>
                <div>手机号：{details ? details.mobile : '暂无数据'}</div>
                <div>来自：{details ? details.area : '暂无数据'}</div>
                <div>身份证：{(details && details.idUrls) ?
                    details
                        .idUrls
                        .map((item,key) => (<Image style={{width: 40,marginLeft:10}} key={key} src={item}/>))
                    : null
                }
                </div>
            </div>
        )
    }
}

const mapState = state => ({
    ...state.users

});

const mapDispatch = dispatch => ({
    ...dispatch.users
})

export default connect(mapState, mapDispatch)(ShowUserInfo);